Use ".ts" suffixed code action kinds - #63951
Conversation
There was a problem hiding this comment.
Pull request overview
Scopes TypeScript source actions with .ts while preserving hierarchical parent-kind requests.
Changes:
- Adds scoped action-kind constants and hierarchical matching.
- Advertises and returns scoped action kinds.
- Migrates fourslash helpers and organize-import tests.
Reviewed changes
Copilot reviewed 67 out of 67 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
tsc/internal/lsp/server.go |
Advertises scoped action kinds. |
tsc/internal/lsp/lsproto/lsp.go |
Adds scoped constants and hierarchy matching. |
tsc/internal/ls/organizeimports.go |
Handles scoped organize-import kinds. |
tsc/internal/ls/codeactions.go |
Returns scoped actions for parent filters. |
tsc/internal/fourslash/fourslash.go |
Updates action verification helpers. |
tsc/internal/fourslash/tests/organizeImportsWithTraceResolution1_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImportsUnicode4_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImportsUnicode3_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImportsUnicode2_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImportsUnicode1_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImportsType9_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImportsType8_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImportsType7_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImportsType6_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImportsType5_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImportsType4_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImportsType3_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImportsType2_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImportsType11_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImportsType10_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImportsType1_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImportsShebang_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImportsReactJsxDev_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImportsReactJsx_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImportsPathsUnicode4_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImportsPathsUnicode3_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImportsPathsUnicode2_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImportsPathsUnicode1_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImportsGroup_Newline_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImportsGroup_MultiNewlines_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImportsGroup_MultilineCommentInNewline_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImportsGroup_CommentInNewline_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImportsAttributes4_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImportsAttributes3_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImportsAttributes2_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImportsAttributes_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImports9_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImports8_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImports7_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImports6_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImports5_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImports4_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImports3_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImports23_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImports22_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImports21_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImports20_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImports2_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImports19_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImports18_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImports17_test.go |
Uses scoped sort-imports kind. |
tsc/internal/fourslash/tests/organizeImports16_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImports15_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImports14_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImports13_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImports12_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImports11_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImports10_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImports1_test.go |
Tests parent request and scoped result. |
tsc/internal/fourslash/tests/organizeImports_typeOrderSameModule_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImports_sortModuleSpecifiers_test.go |
Uses scoped sort-imports kind. |
tsc/internal/fourslash/tests/organizeImports_removeUnused_preservesMultiline_test.go |
Uses scoped remove-unused kind. |
tsc/internal/fourslash/tests/organizeImports_removeOnly_test.go |
Uses scoped remove-unused kind. |
tsc/internal/fourslash/tests/organizeImports_exportLeadingComment_test.go |
Uses scoped sort-imports kind. |
tsc/internal/fourslash/tests/organizeImports_dtsUnusedImportWithAugmentation_test.go |
Uses scoped organize-import kind. |
tsc/internal/fourslash/tests/organizeImports_coalesceImports_test.go |
Uses scoped sort-imports kind. |
tsc/internal/fourslash/tests/organizeImports_coalesceExports_test.go |
Uses scoped sort-imports kind. |
|
Though, now with content mappers exposing other languages, maybe this is cursed |
|
Andrew Branch (@andrewbranch) Do you have any thoughts about this in the context of content mappers? |
|
Is this just an opaque identifier that is now less likely to collide with other providers, or does the name get parsed out and used by clients in some way? |
|
It's not opaque per se, it's just that the user can ask an editor "apply fixes from this category" and then the |
|
By that reasoning, perhaps this means that it's fine with content mappers, since we are "the provider" and the mapping is just a detail of what we are offering to the user, and it's not like linters are coming into play here. |
Andrew Branch (andrewbranch)
left a comment
There was a problem hiding this comment.
Yeah, that's what I was getting at—I think we should be considered the provider for the code fixes we provide in other file extensions through content mappers. I don't see a reason to scope them differently.
Fixes #63823
Advertise
source.fixAll.tsetc instead of justsource.fixAll. This matchestypescript-language-serverallowing scoped fixing.We don't need to actually keep and declare
source.fixAlletc (without.tssuffix), because the fix naming system is hierarchical; we in fact copied a helper from VS Code that does this matching, which I've moved into the method.For consistency, I've changed all of the testing to just use the defined one, which works.
(A previous PR for this was more complicated, but it turns out we don't need much. Most changes are test churn.)